package com.hong.proxy;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

/**
 * Created by John on 2018/10/31.
 */
public class RequestCtrlClallback implements MethodInterceptor {

    @Override
    public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
        if (method.getName().equals("request")){
            System.out.println("CGLIB proxy");
            return methodProxy.invokeSuper(o,objects);
        }
        return null;
    }
}
